<?phpnamespace App\Http\Middleware;use Closure;use Session , Config , Cookie;class WebAuth{    /**     * Handle an incoming request.     *     * @param  \Illuminate\Http\Request  $request     * @param  \Closure  $next     * @param  string|null  $guard     * @return mixed     */    public function handle($request , Closure $next)    {        $userInfo = session::get(Cookie::get(Config::get('session.shanghui_cookie')));        if(!isset($userInfo['id'])){            $loginUrl = Config::get('app.url').'/login';            return response()->json(['code' => 0 , 'msg' => '没有登录' , 'data' => [$loginUrl] ]);        }        global $g_webid;        $g_webid = $userInfo['id'];        $response = $next($request);        return $response;    }}